package com.qyhl.shop.shop.news;

import com.qyhl.webtv.commonlib.entity.shop.ShopDetailNewsBean;

import java.util.List;

public class ShopNewsListPresenter implements ShopNewsListContract.ShopNewsListPresenter {
    private ShopNewsListModel mModel;
    private ShopNewsListContract.ShopNewsListView mView;

    public ShopNewsListPresenter(ShopNewsListContract.ShopNewsListView mView) {
        this.mView = mView;
        this.mModel = new ShopNewsListModel(this);
    }

    @Override
    public void getList(int page) {
        mModel.getList(page);
    }

    @Override
    public void setList(List<ShopDetailNewsBean> beanList) {
        if (beanList == null || beanList.size() < 1) {
            mView.setList(null);
        } else {
            mView.setList(beanList);
        }
    }

    @Override
    public void setError(String msg) {
        mView.setError(msg);
    }
}
